﻿using System;
using System.Collections;
using UnityEngine;

[Serializable]
[CreateAssetMenu(menuName = "Assets/AttributeData/EnemyAttributeData", fileName = "AttributeData_")]
public class EnemyAttributeData : AttributeData
{
    [Header("是否打开Debug")]
    public bool isDebug = false;
    [Header("基本属性"), SerializeField]
    private LayerMask playerLayerMask;
    [SerializeField]
    private LayerMask obstacleLayerMask;
    [Header("空状态"), SerializeField]
    private float nullDuration = 2f;
    [Header("空闲状态"), SerializeField]
    private float idleTime;
    [Header("巡逻状态"), SerializeField]
    private float patrolMaxDuration = 10f;
    [Header("追踪状态"), SerializeField]
    private float pursuitMoveSpeed;
    [SerializeField]
    private float pursuitRangeRadius;
    [Header("攻击状态"), SerializeField]
    private float attackRangeRadius;
    private float attackInterval = 3f;
    //[Header("受伤状态"), SerializeField]
    //[Header("死亡状态"), SerializeField]

    public LayerMask PlayerLayerMask
    {
        get { return playerLayerMask; }
        set { playerLayerMask = value; }
    }
    public LayerMask ObstacleLayerMask
    {
        get { return obstacleLayerMask; }
        set { obstacleLayerMask = value; }
    }
    public float NullDuration
    {
        get { return nullDuration; }
        set
        {
            nullDuration = value;
            if (nullDuration < 0)
            {
                nullDuration = 0;
            }
        }
    }
    public float IdleTime
    {
        get { return idleTime; }
        set
        {
            idleTime = value;
            if(idleTime < 0)
            {
                idleTime = 0;
            }
        }
    }
    public float PatrolMaxDuration
    {
        get { return patrolMaxDuration; }
        set
        {
            patrolMaxDuration = value;
            if (patrolMaxDuration < 0)
            {
                patrolMaxDuration = 0;
            }
        }
    }
    public float PursuitMoveSpeed
    {
        get { return pursuitMoveSpeed; }
        set
        {
            pursuitMoveSpeed = value;
            if (pursuitMoveSpeed < 0)
            {
                pursuitMoveSpeed = 0;
            }
        }
    }
    public float PursuitRangeRadius
    {
        get { return pursuitRangeRadius; }
        set
        {
            pursuitRangeRadius = value;
            if (pursuitRangeRadius < 0)
            {
                pursuitRangeRadius = 0;
            }
        }
    }
    public float AttackRangeRadius
    {
        get { return attackRangeRadius; }
        set
        {
            attackRangeRadius = value;
            if (attackRangeRadius < 0)
            {
                attackRangeRadius = 0;
            }
        }
    }
    public float AttackInterval
    {
        get { return attackInterval; }
        set
        {
            attackInterval = value;
            if (attackInterval < 0)
            {
                attackInterval = 0;
            }
        }
    }
}